<!--#include file="../../core/common/Conn.asp" -->
<!--#include file="../../core/common/Limit.asp" -->
<%
	dim action
	action = request.QueryString("action")
	if action = "del" then
		call del
	end if
	
	'删除栏目
	sub del
		dim ID
		ID = request.QueryString("id")
		db.execute("delete from [SUBJECT] where ID like '" & ID & "%'")
		
		response.Redirect("list.asp")
	end sub
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMSLite for ASP</title>
<link href="../resource/css/reset.css" rel="stylesheet" type="text/css" />
<link href="../resource/css/main.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 7]>
<link href="../resource/css/ie7.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="../resource/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../resource/js/common.js"></script>
</head>

<body>
<div class="bottom_bar">
<input type="button" class="button" value="新增一级栏目" onclick="location.href='add.asp';" />
</div>
<table border="0" cellspacing="0" cellpadding="0" class="table_style_1">
	<thead>
		<tr>
			<th>栏目名称</th>
			<th width="100"></th>
			<th width="100">栏目类型</th>
			<th width="100">栏目编号</th>
			<th width="84">修改</th>
			<th width="84">删除</th>
		</tr>
	</thead>
	<tbody>
	<%
		dim text_indent,background_position
		dim sql,rs
		sql = "select s.*,m.NAME as MODULE_NAME "_
			+ "from [SUBJECT] s "_
			+ "left join [MODULE] m "_
			+ "on s.MODULEID = m.ID "_
			+ "order by s.ID asc"
		set rs = db.query(sql)
		if not rs.eof then
			do while not rs.eof
	%>
		<tr>
			<td class="main" <%
				text_indent = ((len(rs("ID")) / 3) * 35)
				background_position = ((((len(rs("ID")) / 3) - 1) * 35) + 10)
				response.Write("style="""_
							 & "text-indent:" & text_indent & "px;"_
							 & "background-position:" & background_position & "px 5px;""")
			%>><a href="edit.asp?id=<%=rs("ID")%>"><%=rs("NAME")%></a></td>
			<td><a href="add.asp?pid=<%=rs("ID")%>">新增子栏目</a></td>
			<td><%=rs("MODULE_NAME")%></td>
			<td><%=rs("ID")%></td>
			<td><a href="edit.asp?id=<%=rs("ID")%>">修改</a></td>
			<td><a href="?action=del&id=<%=rs("ID")%>">删除</a></td>
		</tr>
	<%
				rs.movenext
			loop
		end if
		rs.close
		set rs = nothing
	%>
	</tbody>
</table>
</body>
</html>
